package server.core.factory;

import server.core.AbstractSend2Data;
import server.core.AbstractSenderFactory;
import server.core.sender.CommonTcpSender;
import server.core.sender.HGSTcpSender;
import sun.jvm.hotspot.debugger.posix.elf.ELFException;

/**
 * describe:
 *
 * @author helloworldyu
 * @data 2018/1/25
 */
public class TcpSenderFactory extends AbstractSenderFactory {

	private final static String COMMON = "COMMON";
	private final static String HGS = "HGS";

	@Override
	public AbstractSend2Data createSender(String condition) {
		System.out.println("我费很大的劲搞出一个 tcp 的下发实现类");
		if( COMMON.equals(condition) ){
			return new CommonTcpSender("tcp sender");
		}else if ( HGS.equals(condition) ){
			return new HGSTcpSender("hgs sender");
		}
		else {
			return null;
		}
	}
}